extends "../banglebase/banglebase.gd"
var cnt 
var cnt2
var cnt3
func init():
    .init()
    name = "毒手镯"
    resetdata()
    att.atk = 15
    att.penL = 0.08
    att.mgiPenL = 0.08
    info = "荼毒：所有攻击[特效伤害除外]附带<毒种>\n[装备每次只能附加一个对象，只有当对象身上没有本装备添加的冰种才可以切换对象附加，可以和别的装备附加同一个对象]"

func _connect():
    ._connect()
    masCha.connect("onAtkChara",self,"adddu")
    masCha.connect("onBattleStart",self,"resetcnt")

func resetcnt():
	cnt = 0
	cnt2 = 0
	cnt3 = 0

func adddu(atkinfo):
    if atkinfo.hitCha != target && target != null:return
    if atkinfo.isMiss || atkinfo.atkType == Chara.AtkType.EFF:return
    var bf = atkinfo.hitCha.hasBuff("b_duzhong")
    var lf = 6
    if masCha.hasBuff("DY"):lf = 10
    if !bf:
        target = atkinfo.hitCha
        atkinfo.hitCha.addBuff(ctrl.b_duzhong.new(lf,1,self))
    else:
        bf.life += lf
        bf.cnt += 1
        if bf.cnt >= 9:
            bf.isDel = true
            var pws = 1.5
            if self.id.find("25") != -1:pws = 1.88
            masCha.hurtChara(atkinfo.hitCha,masCha.att.atk * pws,Chara.HurtType.REAL,Chara.AtkType.EFF)

class MYD:
	extends Buff
	var canremove:bool = false
	var binglist = ["b_d","b_zd","b_zhonDu","b_duwu"]
	func _init(lv):
		attInit()
		life = lv * 4

	func _connect():
		masCha.connect("onAddBuff",self,"run")

	func run(buff):
		if binglist.find(buff.id) != -1:
			buff.isDel = true